package com.wsd.exception;


import java.io.Serial;

/**
 * 自定义异常
 * source from: 人人开源
 * source from: https://www.renren.io
 */
public class RRException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private String msg;
    private Integer code = 500;

    public RRException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public RRException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public RRException(String msg, Integer code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public RRException(String msg, Integer code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

    public String getMessage() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
